package com.example.administrator.wallet.base;

import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.blankj.utilcode.util.ToastUtils;

import butterknife.ButterKnife;


/**
 * Effect:
 * <p>
 * Author:  CaiYapeng
 * <p>
 * Time  :  2018/7/4.
 */

public abstract class BaseFragment extends Fragment {
    private View rootView;
    private static DisplayMetrics dm;
    public static boolean isChainese = true;
    private static Resources resources;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(getLayoutResource(), container, false);
        ButterKnife.bind(this, rootView);
        initOnCreate();
        return rootView;
    }

    public void initOnCreate() {

    }


    @Override
    public void onStart() {
        super.onStart();
        init();
    }


    public void toast(String msg) {
        ToastUtils.showShort(msg);
    }

    public abstract void init();

    public abstract int getLayoutResource();
}
